package com.devops.admin.controller;

import com.devops.admin.service.DOSExportDataJobLogService;
import com.devops.admin.vo.ExportDataJobCallBack;
import com.devops.common.utils.Message;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author jxt
 * @Notes
 * @date 2023/12/26 15:57
 */
@Slf4j
@RestController
@RequestMapping("/export/data")
@Api(value = "/export/data",tags = "导出数据执行器回调")
public class ExecutorCallbackController {
    @Resource
    private DOSExportDataJobLogService exportDataJobLogService;
    @PostMapping(value = "/notify")
    @ApiOperation(value="导出数据执行器回调接口",notes = "导出数据执行器回调接口")
    public Message callBack(@RequestBody ExportDataJobCallBack callBack) {
        exportDataJobLogService.handleCallback(callBack);
        return Message.ok("操作成功");
    }
}
